package com.macro.mall.portal.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.macro.mall.common.api.CommonResult;
import com.macro.mall.model.BmsDictData;
import com.macro.mall.portal.service.BmsDictDataService;
import com.macro.mall.request.BmsDictDataParam;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.tags.Tag;

@Controller
@Api(tags = "BmsDictDataController")
@Tag(name = "BmsDictDataController", description = "字典值表")
@RequestMapping("/dictData")
public class BmsDictDataController {

    @Autowired
    private BmsDictDataService bmsDictDataService;

    @ApiOperation("根据类型表value获取list")
    @RequestMapping(value = "/findListByType", method = RequestMethod.POST)
    @ResponseBody
    public CommonResult<List<BmsDictData>> findListByType(@RequestBody BmsDictDataParam query) {
        return CommonResult.success(bmsDictDataService.selectList(query));
    }

}
